(a) was receivedi. in any case where the dividend was designated under section 666 or 667 by the trust, when the trust, the beneficiary and persons with whom the beneficiary was not dealing at arm’s length did not own in total more than 5% of the issued shares of any class of the capital stock of the corporation from which the dividend was received, or
ii. in any other case, when the trust and persons with whom the trust was not dealing at arm’s length did not own in total more than 5% of the issued shares of any class of the capital stock of the corporation from which the dividend was received; and